<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../js/jquery.min.js"></script>
</head>
<body>
<form class="layui-form" lay-filter="userForm" id="add_user_form" action="" style="padding:15px 10px;">
    <input type="hidden" name="rid">

    <div class="layui-row">
        <div class="layui-col-xs6">
            <div class="layui-form-item">
                <label class="layui-form-label">患者姓名</label>
                <div class="layui-input-block">
                    <input type="text" name="rname" required  lay-verify="required" placeholder="患者" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-col-xs6">
            <div class="layui-form-item">
                <label class="layui-form-label">病单号</label>
                <div class="layui-input-block">
                    <input type="text" id="dis" name="disoddid"  lay-verify="required"p laceholder="" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>
    </div>


    <div class="layui-row">
        <div class="layui-col-xs5">
            <div class="layui-form-item">
                <label class="layui-form-label">身份证号</label>
                <div class="layui-input-block">
                    <input type="text" name="idnumber" required  lay-verify="required" placeholder="身份证号" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-col-xs5">
            <div class="layui-form-item">
                <label class="layui-form-label">手机号</label>
                <div class="layui-input-block">
                    <input type="text" name="phone" required lay-verify="required" placeholder="手机号" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-col-xs3">
            <div class="layui-form-item">
                <label class="layui-form-label">性别</label>
                <div class="layui-input-block">
                    <input type="radio" name="sex" value="男" title="男">
                    <input type="radio" name="sex" value="女" title="女" checked>
                </div>
            </div>
            <!--<div class="layui-form-item">-->
            <!--<label class="layui-form-label">性别</label>-->
            <!--<div class="layui-input-block">-->
            <!--<input type="text" name="sex" required  lay-verify="required" placeholder="性别" autocomplete="off" class="layui-input">-->
            <!--</div>-->
            <!--</div>-->
        </div>
    </div>


    <div class="layui-row">
        <div class="layui-col-xs4">
            <div class="layui-form-item">
                <label class="layui-form-label">诊断项目</label>
                <div class="layui-input-block">
                    <select name="operid" lay-verify="required" id="de_add">
                        <option value=""></option>
                    </select>
                </div>
                <!--<div class="layui-input-block">-->
                <!--<input type="text" name="operid" required  lay-verify="required" placeholder="诊断项目" autocomplete="off" class="layui-input">-->
                <!--</div>-->
            </div>
        </div>
        <div class="layui-col-xs4">
            <div class="layui-form-item">
                <label class="layui-form-label">就诊时间</label>
                <div class="layui-input-block">
                    <input type="date" name="retime" required  lay-verify="required" placeholder="就诊时间" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-col-xs4">
            <div class="layui-form-item">
                <label class="layui-form-label">结束时间</label>
                <div class="layui-input-block">
                    <input type="date" name="retimeall" required  lay-verify="required" placeholder="结束时间" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-col-xs6">
            <div class="layui-form-item">
                <label class="layui-form-label">预约医生</label>
                <div class="layui-input-block">
                    <select name="medid" lay-verify="required" id="user">
                        <option value=""></option>
                    </select>
                </div>
                <!--<div class="layui-input-block">-->
                <!--<input type="text" name="medid" required  lay-verify="required" placeholder="医生" autocomplete="off" class="layui-input">-->
                <!--</div>-->
            </div>
        </div>
        <div class="layui-col-xs6">
            <div class="layui-form-item">
                <label class="layui-form-label">挂号费</label>
                <div class="layui-input-block">
                    <input type="text" name="fee" required  lay-verify="required" placeholder="挂号费" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <input type="text" name="remarks" required  lay-verify="required" placeholder="备注" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-xs6">
            <div class="layui-form-item">
                <label class="layui-form-label">状态</label>
                <div class="layui-input-block">
                    <select name="typeid" lay-verify="required" id="ty">
                        <option value=""></option>
                    </select>
                    <!--<input type="text" name="typeid" required  lay-verify="required" placeholder="状态" autocomplete="off" class="layui-input">-->
                </div>
            </div>
        </div>
        <!--<div class="layui-col-xs6">-->
        <!--<div class="layui-form-item">-->
        <!--<label class="layui-form-label">客户</label>-->
        <!--<div class="layui-input-block">-->
        <!--<input type="text" name="cid" required  lay-verify="required" placeholder="客户" autocomplete="off" class="layui-input">-->
        <!--</div>-->
        <!--</div>-->
        <!--</div>-->
    </div>
</form>

<script>
    $(function (){
        var s = Math.floor(Math.random()*1000000);
        $("#dis").val(s);
    })
    $.get("http://localhost:8888/ill/search",function(data){
        $.each(data,function(){
            var opt = $("<option></option>").appendTo("#de_add");
            opt.text(this.illnessName).val(this.id);
        });
        layui.form.render();
    });
    $.get("http://localhost:8888/user/search",function(data){
        $.each(data,function(){
            var opt = $("<option></option>").appendTo("#user");
            opt.text(this.username).val(this.userid);
        });
        layui.form.render();
    });
    $.get("http://localhost:8888/rtype/search",function(data){
        $.each(data,function(){
            var opt = $("<option></option>").appendTo("#ty");
            opt.text(this.typename).val(this.typeid);
        });
        layui.form.render();
    });
</script>
</body>
</html>